import moment from 'moment';
import { useState } from 'react';
import styles from './index.less';

const TradeCenterTime = ({}) => {
  const [date, setDate] = useState(moment());
  const getNewDate = () => {
    setDate(moment());
  };
  setTimeout(getNewDate, 500);
  return (
    <div className={styles.tradeCenterTime}>
      <span className={styles.time}>{moment(date).format('HH:mm:ss')}</span>
      <div className={styles.dateAndWeek}>
        <span>{moment(date).format('YYYY年MM月DD日')}</span>
        <span>{moment(date).format('dddd')}</span>
      </div>
    </div>
  );
};

export default TradeCenterTime;
